#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test synthetic_events syntax parser errors
# requires: synthetic_events error_log

check_error() { # command-with-error-pos-by-^
    ftrace_errlog_check 'synthetic_events' "$1" 'synthetic_events'
}

check_error 'myevent ^chr arg'			# INVALID_TYPE
check_error 'myevent ^char str[];; int v'	# INVALID_TYPE
check_error 'myevent char ^str]; int v'		# INVALID_NAME
check_error 'myevent char ^str;[]'		# INVALID_NAME
check_error 'myevent ^char str[; int v'		# INVALID_TYPE
check_error '^mye;vent char str[]'		# BAD_NAME
check_error 'myevent char str[]; ^int'		# INVALID_FIELD
check_error '^myevent'				# INCOMPLETE_CMD

exit 0
